import pandas as pd
from pyecharts.charts import  Pie
from pyecharts import  options as opts
from pyecharts.options import InitOpts,TitleOpts,LegendOpts,ToolboxOpts,VisualMapOpts,AxisOpts


data=pd.read_excel("副本Problem_C_Data_Wordle.xlsx")
num=list(data["num"])#每日报告数量
date=list(data["date"])#日期
hard=list(data["hard"])#每日困难报告数量
month=list(data["month"])#月份
data=list(data["data"])#每月报告数量
list=[list(z)for z in zip (num,date,hard,month,data)]


pie1=Pie(init_opts=InitOpts(width="1500px",height="600px",page_title="尝试比例饼图",theme="white",))

pie1.add(series_name="try scale",
         data_pair=[("1 try",0.47),("2 tries",5.85),("3 tries",22.73),("4 tries",32.94),("5 tries",23.64),("6 tries",11.56),("X",2.81)],
         color=None)

pie1.set_global_opts(
    TitleOpts(title="Pie chart with the number of attempts scale",pos_left='center',pos_top='bottom')
)

pie1.render("尝试比例饼图.html")